<template>
	<view class="index">
		<xps-generate-form ref="xps-generate-form" :data="formData" />
		<button @tap="submit">提交</button>
	</view>
</template>

<script>
export default {
	data() {
		return {
			formData: {}
		}
	},
	onLoad() {
		const json = require('../../json/index.json')
		setTimeout(() => {
			this.formData = json
		}, 200)
	},
	methods: {
		submit() {
			this.$refs['xps-generate-form'].getData().then(data => {
				console.log(data, 'submit data')
			})
		}
	}
}
</script>

<style scoped>
.index {
	width: 100%;
	height: 100%;
}
</style>
